class Solution {
public:
    int countBalls(int lowLimit, int highLimit) {
        int ret=0;
        vector<int> box(100);
        for(int i=lowLimit;i<=highLimit;i++)
        {
            int idx=0;
            int t=i;
            while(t)
            {
                idx+=t%10;
                t/=10;
            }
            box[idx]++;
            ret=max(box[idx],ret);
        }
        return ret;
    }
};
